﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ColaboradorCapacidades.aspx.cs" Inherits="WebSite.ColaboradorCapacidades" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@ MasterType VirtualPath="~/Site.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphContenido" runat="server">
    <div class="intro">
        <div class="pad">
            <div style="TEXT-ALIGN:center; height:30px"><a href="Inicio.aspx"><strong>Regresar a la Página Principal</strong></a></div>              
            <h3 style="color:White">Administrar Capacidades de Colaboradores</h3>
        </div>
    </div>
    <br />
    <div class="textbox">
        <h3 style="height:5px">Buscar Colaborador</h3> 
        <h2></h2>
        <table style="width:"100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width:15%; text-align:center">Legajo:</td>
                <td style="width:20%"><asp:TextBox ID="txtLegajoBuscar" runat="server"></asp:TextBox>
                    
                    <asp:RoundedCornersExtender ID="txtLegajoBuscar_RoundedCornersExtender" 
                        runat="server" Enabled="True" TargetControlID="txtLegajoBuscar" corners="All" radius="3" BorderColor="#cccccc">
                    </asp:RoundedCornersExtender>
                </td>
                <td style="width:15%; text-align:center">Apellido:</td>
                <td style="width:20%"><asp:TextBox ID="txtApellidoBuscar" runat="server"></asp:TextBox>
                    
                    <asp:RoundedCornersExtender ID="txtApellidoBuscar_RoundedCornersExtender" 
                        runat="server" Enabled="True" TargetControlID="txtApellidoBuscar" corners="All" radius="3" BorderColor="#cccccc">
                    </asp:RoundedCornersExtender>
                </td>
                <td style="width:15%; text-align:center"><asp:CheckBox ID="chkActivo" Text="Solo Activos" Checked="true" runat="server" /></td>
                <td style="width:15%; text-align:right"><asp:ImageButton ID="cmdBuscar" 
                        runat="server" ImageUrl="Imagenes/Botones/boton_buscar.png" 
                        onclick="cmdBuscar_Click" />                    
                </td>
            </tr>
        </table>      
    </div>
    <!-- Fin buscarColaboradores -->

    <div class="textbox" id="secListaColaboradores" runat="server" >
        <h3 style="height:5px">Listado de Colaboradores</h3>         
        <h2></h2>
        <asp:UpdatePanel ID="UpdListadoColaboradores" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:GridView id="GrdColaboradores" runat="server" Width="100%" ForeColor="#333333" 
                GridLines="None" CellPadding="4" AutoGenerateColumns="False" 
                    AllowPaging="True" PageSize="10" 
                    onpageindexchanging="GrdColaboradores_PageIndexChanging" 
                    onrowcommand="GrdColaboradores_RowCommand" >
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <Columns>
                            <asp:BoundField DataField="Legajo" HeaderText="Legajo">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                            <asp:BoundField DataField="Apellido" HeaderText="Apellido">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                            <asp:BoundField DataField="Nombre" HeaderText="Nombre">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                            <asp:BoundField DataField="SectorDescripcion" HeaderText="Sector">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                            <asp:ButtonField CommandName="Asignar" Text="Asignar">
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" ForeColor="#0B6138" />
                            </asp:ButtonField>   
                            <asp:ButtonField CommandName="ActivarDesactivar">
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" ForeColor="#0B6138" />
                            </asp:ButtonField>                          
                            <asp:BoundField DataField="IdColaborador" Visible="False" />
                            <asp:BoundField DataField="Id" Visible="False" />                                                       
                            <asp:BoundField DataField="SectorId" Visible="False" />                                                       
                    </Columns>
                    <FooterStyle BackColor="#9CC146" ForeColor="White" Font-Bold="True" />
                    <PagerStyle BackColor="#9CC146" ForeColor="White" HorizontalAlign="Right" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#9CC146" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                </asp:GridView>                 
                <br />                          
            </ContentTemplate>
        </asp:UpdatePanel>           
    </div>

    <div class="textbox" id="secDatosColaborador" runat="server">
        <h3 style="height:5px">Datos Colaborador</h3>        
        <h2></h2>
        <asp:UpdatePanel ID="updDetalleColaborador" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                
                <table style="width:100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>Legajo:</td>
                        <td><asp:TextBox ID="txtLegajo" runat="server"></asp:TextBox>
                            <asp:RoundedCornersExtender ID="txtLegajo_RoundedCornersExtender" 
                                runat="server" Enabled="True" TargetControlID="txtLegajo" corners="All" radius="3" BorderColor="#cccccc">
                            </asp:RoundedCornersExtender>
                        </td>
                    </tr>                    
                    <tr>
                        <td>Nombres:</td>
                        <td><asp:TextBox ID="txtNombres" runat="server"></asp:TextBox>
                            <asp:RoundedCornersExtender ID="txtNombres_RoundedCornersExtender" 
                                runat="server" Enabled="True" TargetControlID="txtNombres" corners="All" radius="3" BorderColor="#cccccc">
                            </asp:RoundedCornersExtender>
                        </td>
                    </tr>
                    <tr>
                        <td>Apellido:</td>
                        <td><asp:TextBox ID="txtApellido" runat="server"></asp:TextBox>
                            <asp:RoundedCornersExtender ID="txtApellido_RoundedCornersExtender" 
                                runat="server" Enabled="True" TargetControlID="txtApellido" corners="All" radius="3" BorderColor="#cccccc">
                            </asp:RoundedCornersExtender>
                        </td>
                    </tr>                    
                    <tr>
                        <td>Sector:</td>
                        <td>
                            <asp:DropDownList ID="ddlSector" runat="server">
                            </asp:DropDownList>                    
                        </td>
                    </tr>
                </table>
                <br />
                <table style="width:100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width:49%"><h2>Capacidades disponibles</h2></td>
                        <td style="width:2%"></td>
                        <td style="width:49%"><h2>Capacidades asignadas</h2></td>
                    </tr>
                    <tr>
                        <td>Cantidad registros:&nbsp;<asp:Label ID="lblCantCapacDisponibles" runat="server"></asp:Label></td>
                        <td>
                        </td>
                        <td>
                            Cantidad registros:&nbsp;<asp:Label ID="lblCantCapacAsignadas" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            <table style="width:100%; border:0; margin: 10px 0px">
                                <tr>
                                    <td>Buscar&nbsp;</td>
                                    <td>
                                        <asp:TextBox ID="txtBuscarCapacidad" runat="server" MaxLength="50" Width="150px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="cmdBuscarCapacidad" runat="server" 
                                            ImageUrl="Imagenes/Botones/boton_buscar.png" 
                                            onclick="cmdBuscarCapacidad_Click" />
                                        
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="vertical-align:top">
                            <asp:GridView ID="GrdCapacidadesDisponibles" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnRowCommand="GrdCapacidadesDisponibles_RowCommand" OnPageIndexChanging="GrdCapacidadesDisponibles_PageIndexChanging"
                                CellPadding="4" GridLines="None" Width="100%" ForeColor="#333333"  PageSize="5">
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                <Columns>
                                    <asp:BoundField DataField="Id" Visible="False">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="nombre">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    
                                    <asp:ButtonField CommandName="Agregar" Text="Agregar">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:ButtonField>
                                </Columns>
                                <FooterStyle BackColor="#9CC146" ForeColor="White" Font-Bold="True" />
                                <PagerStyle BackColor="#9CC146" ForeColor="White" HorizontalAlign="Right" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#9CC146" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#999999" />
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            </asp:GridView>
                        </td>
                        <td></td>
                        <td style="vertical-align:top">
                            <asp:GridView ID="GrdCapacidadesAsignadas" runat="server" AllowPaging="True" AutoGenerateColumns="False" 
                            OnRowCommand="GrdCapacidadesAsignadas_RowCommand" OnPageIndexChanging="GrdCapacidadesAsignadas_PageIndexChanging" 
                            OnRowEditing="GrdCapacidadesAsignadas_RowEditing"
                            OnRowCancelingEdit="GrdCapacidadesAsignadas_RowCancelingEdit" 
                            OnRowUpdating="GrdCapacidadesAsignadas_RowUpdating"
                            OnRowDataBound="GrdCapacidadesAsignadas_RowDataBound" CellPadding="4" GridLines="None" 
                            Width="100%" ForeColor="#333333" PageSize="5">
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                <Columns>
                                    <asp:BoundField DataField="Id" Visible="False">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Nombre">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    
                                    <asp:TemplateField HeaderText="Nivel Capacidad">
                                        <ItemTemplate>
                                            <asp:Label ID="LblNivel" runat="server" Text='<%# Eval("Nivel.Nombre") %>'></asp:Label>
                                        </ItemTemplate>
                                       <EditItemTemplate>
                                            <asp:DropDownList  ID="DdlNivel" runat="server"></asp:DropDownList>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    
                                    <asp:TemplateField ShowHeader="False">
                                        <EditItemTemplate>
                                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                                Text="Actualizar"></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                                Text="Cancelar"></asp:LinkButton>    
                                        </EditItemTemplate>  
                                        <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="Editar"></asp:LinkButton>
                                        </ItemTemplate>                                                      
                                    </asp:TemplateField>
                                    
                                    <asp:ButtonField CommandName="Quitar" Text="Quitar">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:ButtonField>
                                </Columns>
                                <FooterStyle BackColor="#9CC146" ForeColor="White" Font-Bold="True" />
                                <PagerStyle BackColor="#9CC146" ForeColor="White" HorizontalAlign="Right" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#9CC146" />
                                <HeaderStyle BackColor="#9CC146" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="White" />
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>    
                <br />
                <div style="text-align:center">
                    <asp:ImageButton ID="cmdAceptar" runat="server" ImageUrl="Imagenes/Botones/boton_guardar.png" onclick="cmdAceptar_Click"/>
                    <asp:ImageButton ID="cmdCancelar" runat="server" ImageUrl="Imagenes/Botones/boton_cancelar.png" onclick="cmdCancelar_Click" />
                </div>                
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>

    <asp:Label ID="lblExtender" runat="server"></asp:Label>
        <asp:ModalPopupExtender ID="updDetalleColaborador_ModalPopupExtender" 
            runat="server"  Enabled="True" DropShadow="true" BackgroundCssClass="modalBackground"
            TargetControlID="lblExtender" PopupControlID="secDatosColaborador">
        </asp:ModalPopupExtender>

</asp:Content>
